<?php
/**
 * Database Connection Interface
 * @author Frédéric Delorme<frederic.delorme@gmail.com>
 * @version 1.0 - 12/12/2009
 */
interface IConnection{
	/**
	 * Create a connection to the $conn described database.
	 * $conn = array('servertype'	=> "mysql"
	 * 				 'servername'	=> "mysql server name",
	 * 				 'username'		=> "connection user to the server",
	 * 				 'password'		=> "password for the connection user",
	 * 				 'port'			=> "port number for the mysql server",
	 * 				 'database'		=> "name of the database to be connected to.");
	 * @param $conn
	 * @return unknown_type
	 */
	public function open($conn);
	/**
	 * execute a small request on db.
	 * @param unknown_type $sql
	 * @return unknown_type
	 */
	public function execute($sql);
	/**
	 * execute a script SQL on db.
	 * @param string $file sql script to be executed.
	 */
	public function executeScript($file);
	/**
	 * fetch results from resultset
	 * @param unknown_type $rs
	 * @return unknown_type
	 */
	public function fetch($rs);
	
	public function decodeType($type);
	
	public function getTransaction();
}
?>